//
//  HomeTabbarController.swift
//  NetProject
//
//  Created by EDY on 2021/11/1.
//

import Foundation
import UIKit

class HomeTabbarController : JMTabBarController{
    override func viewDidLoad() {
        do {
            try DataUpdate.sharedInstance.postDataWithParam(["test":"1"], "api") { isSuccess, response, errorMsg in
                if isSuccess {
                    let model = response.kj.model(CommonModel.self)
                    print(model)
                }else{
                    
                }
            }
        } catch let aError as NSError {
            print(aError.localizedDescription)
        }
        
        

    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5) {
//            Tools.shared.alert("test") {
//                print("1")
//            } _: {
//                print("2")
//            }
//        }
        
            
        let view = UIView.snpView(supView: self.view, backColor: .orange, tapGesture: nil) { make in
            make.width.equalTo(200)
            make.height.equalTo(40)
            make.center.equalToSuperview()
        }
//
//        Tools.shared.popView(view,CGSize(width: 200, height: 40)) {
//            print("3")
//        }
//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
//            Tools.shared.alertActionSheet("test", ["1dfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdffdfd124dcvgf324","2","3"], true) { index in
//                print("当前点击的是\(index)")
//            }
//        }
        
        Tools.shared.showLoading(msg: "正在加载")
        
        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5) {
            Tools.shared.hideLoading()
        }
        
    }
}
